package cn.crsc.openlookeng.domain;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;

public class Page<T> implements Iterable<T> {


    private final List<T> content = new ArrayList<>();

    private final long total;

    public Page(List<T> content,long total) {
        this.content.addAll(content);
        this.total = total;
    }

    @Override
    public Iterator<T> iterator() {
        return content.iterator();
    }

    @Override
    public void forEach(Consumer<? super T> action) {
        Iterable.super.forEach(action);
    }

    @Override
    public Spliterator<T> spliterator() {
        return Iterable.super.spliterator();
    }
}